﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using MyBet.Helpers;

namespace MyBet.Class
{
    public class User
    {
        /// <summary>
        /// List of roles
        /// </summary>
        public const string AdministratorRole = "Administrator";
        public const string BetManagerRole = "BetManager";
        public const string PlayerRole = "Player";
        public const string RegisteredUsersRole = "Registered Users";

        #region "Attributes"
        private string _login;
        private string _password;
        private int _rank;
        #endregion

        #region "Properties"
        /// <summary>
        /// Rank in the tournment 
        /// </summary>
        public int Rank
        {
            get { return _rank; }
            set { _rank = value; }
        }

        /// <summary>
        /// User login
        /// </summary>
        public string Login
        {
            get { return _login; }
            set
            {
                // Login can not be empty
                if (String.IsNullOrEmpty(value))
                {
                    throw new Exception(LangHelper.GetString("ErrLoginEmpty"));
                }
                _login = value;
            }
        }

        /// <summary>
        /// User password
        /// </summary>
        public string Password
        {
            get { return _password; }
            set
            {
                if (String.IsNullOrEmpty(value))
                {
                    throw new Exception(LangHelper.GetString("ErrPasswordEmpty"));
                }
                _password = value;
            }
        }

        #endregion

    }
}
